package com.ymm.system.api.facade;

import com.ymm.system.api.dto.OrderAndCargoInfoResponse;
import com.ymm.system.api.dto.ShipperOrderBriefResponse;
import com.ymm.system.api.dto.ShipperOrderDetailResponse;
import com.ymm.system.api.utils.Result;

import java.util.List;

/**
 * 货主处理订单 服务
 *
 * @author guorui
 */
public interface SystemShipperOrderService {

    /**
     * 取消订单 但不下架货源
     */
    Result<Boolean> cancelOrderWithoutPullOffCargo(Long orderId, Long shipperId, Integer orderCancelReason, String orderCancelDescription) throws Exception;

    /**
     * 取消订单 并且下架货源
     */
    Result<Boolean> cancelOrderWithPullOffCargo(Long orderId, Long shipperId, Integer orderCancelReason, String orderCancelDescription) throws Exception;

    /**
     * 确认收货
     */
    Result<Boolean> confirmReceipt(Long orderId, Long shipperId) throws Exception;

    /**
     * 查看订单详细信息
     */
    Result<ShipperOrderDetailResponse> getOrderDetailByOrderId(Long orderId);

    /**
     * 查看在上架状态中的订单
     */
    Result<List<ShipperOrderBriefResponse>> listOngoingOrdersByShipperId(Long shipperId, Integer orderShipperState);

    /**
     * 查看已完成的货源
     */
    Result<List<ShipperOrderBriefResponse>> listCompletedOrdersByShipperId(Long shipper, Integer orderShipperState);

    /**
     * 查看已取消的货源
     */
    Result<List<ShipperOrderBriefResponse>> listCancelledOrdersByShipperId(Long shipperId, Integer orderShipperState);

    /**
     * 获取司机联系方式
     *
     * @param orderId 订单id
     * @return 司机联系方式
     */
    Result<String> getDriverPhoneNumber(Long orderId);

    /**
     * 查看自己收货的订单
     */
    Result<List<ShipperOrderDetailResponse>> listOrderDetailByReceiverPhone(String cargoReceiverPhone);

    /**
     * 获取指定订单包含货源详情
     *
     * @param orderId
     * @return
     */
    Result<OrderAndCargoInfoResponse> getOrderAndCargoInfoByOrderId(Long orderId);

}
